Back
 
Special thanks to Tony Dwyer for his great contributions!
name Chaos2
author Tony Dwyer
iff code xxx2xxx3xxx4
raise shield
move forward
pscan:
scan perimeter
if scan found enemy then
   discharge energy
   goto pscan
end if
if scan found mine then discharge energy
lscan:
long range scan
if scan found enemy then goto missle
if scan found flag then goto flag1
turn left
long range scan
if scan found enemy then goto missle
if scan found flag then goto flag1
turn left
scan perimeter
if scan found enemy then goto pscan
long range scan 
if scan found enemy then goto missle 
if scan found flag then goto flag1
turn left
long range scan 
if scan found enemy then goto missle
if scan found flag then goto flag1
turn left
long range scan
if scan found enemy then goto missle
if scan found flag then goto flag1
if damage is > 30 then gosub d
goto move
 
nmissile:
turn right
move forward
turn left
move forward
move forward
move forward
move forward
turn left
move forward
turn right
goto scan1
 
missle:
if value #cur_ammo < 10 then goto bar
assign v0 0 
missle1:
lower shield
launch missile
raise shield
turn right
move forward
if bump barrier then 
   move backward
   move backward
   goto pscan
end if
turn left
long range scan
if scan found enemy then goto missle
long range scan
if scan found enemy then goto missle
loop:
math v0 = ~v0 + 1
if value ~v0 < 4 then goto loop
turn left
move forward
turn right
long range scan
if scan found enemy then goto missle
long range scan
if scan found enemy then goto missle
goto lscan
 
flag1:
if value #cur_life = 0 then goto flag3
move forward
move forward
scan perimeter
if scan found enemy then goto pscan
if scan found mine then discharge enrgy
goto lscan
 
flag3:
scan perimeter
if scan found enemy then goto pscan
if scan found flag then
   move backward
   goto flag3
end if
discharge energy
goto lscan
 
scan1:
scan forward
if scan found enemy then
   lower shield
   fire weapon
   raise shield
   move forward
   goto scan1
end if
scan3:
scan perimeter
if scan found enemy then
   discharge energy
   goto scan3
end if
if scan found flag then goto flag1
goto lscan
 
move:
if value #y_pos > #enemy_y then goto n
if facing west then turn left
if facing north then turn right
if facing east then turn right
move forward
scan perimeter
if scan found enemy then
   discharge energy
   goto pscan
end if
if bump barrier then goto bar
if damage is > 30 then gosub d
goto h2
n:
if facing south then turn right
if facing west then turn right
if facing east then turn left
move forward
scan perimeter
if scan found enemy then
   discharge energy
   goto pscan
end if
if bump barrier then goto b
if damage is > 30 then gosub d
h2:
if value #x_pos > #enemy_x then goto w
if facing west then turn right
if facing north then turn right
if facing south then turn left
move forward
scan perimeter
if scan found enemy then
   discharge energy
   goto pscan
end if
if bump barrier then goto bar
if damage is > 30 then gosub d
goto pscan
w:
if facing north then turn left
if facing east then turn right
if facing south then turn right
move forward
scan perimeter
if scan found enemy then
   discharge energy
   goto pscan
end if
if bump barrier then goto bar
if damage is > 30 then gosub d
goto pscan
 
bar:
if facing north then
   if value #cur_x > #enemy_x then
      scan position 7
      if scan found barrier then exit if
      turn left
      goto mo
   end if
   turn right
   goto mo
end if
if facing south then
   if value #cur_x > #enemy_x then
      if scan found barrier then exit if      
      turn right
      goto mo
   end if
   turn left
   goto mo
end if
if facing west then
   if value #cur_y > #enemy_y then
      if scan found barrier then exit if       
      turn right
       goto mo
   end if
   turn left
   goto mo
end if
if facing east then
   if value #cur_y > #enemy_y then
      if scan found barrier then exit if      
      turn left
      goto mo
   end if
   turn right
   goto mo
end if
goto pscan
    
br:
generate random
if random is 1 then goto bar0
if random is 2 then goto bar1
if random is 3 then goto bar0
if random is 4 then goto bar1
 
bar0:
scan left
if scan found barrier then goto bar3
turn left
move forward
goto pscan
 
bar1:
scan right
if scan found barrier goto bar3
turn right 
move forward
goto pscan
 
bar3:
scan left
if scan found barrier then math v0 = ~v0 + 1
scan right
if scan found barrier then math v0 = ~v0 + 2
if value ~v0 = 1 then
   turn right
   move forward
   goto pscan
end if
if value ~v0 = 2 then 
   turn left
   move forward
   goto pscan
end if
if value ~v0 = 3 then 
   move backward
   move backward
end if
if bump barrier then
   assign v0 0
   goto bar
end if
if damage is > 30 then gosub d
goto pscan
d:
lower shield
attempt repairs 
attempt repairs
attempt repairs
attempt repairs
attempt repairs
raise shield
scan perimeter
if scan found enemy then discharge energy
return
 
mo:
scan position 1
if scan found barrier then goto br
move forward
long range scan
if scan found enemy then goto missle
move forward
goto pscan